package 分类算法总的很好.剑指offer;
// https://www.nowcoder.com/practice/7a0da8fc483247ff8800059e12d7caf1?tpId=13&tqId=23248&ru=/ta/sql-quick-study&qru=/ta/sql-quick-study/question-ranking
public class JZ47求1n的和1003 {
    public class Solution {
        public int Sum_Solution(int n) {
            return (int)(Math.pow(n,2)+n)>>1;
        }
    }
    int sum = 0;
    public int Sum_Solution(int n) {
        boolean bool = ((n>=1) && (sum += (n + Sum_Solution(n-1)))>0);
        return sum;
    }
}
